<!doctype html>
<html>
<head>
<meta charset="utf-8">
<script> 
window.onload = function(){
	    var box = document.getElementById("box");			//获取<div id="box">
	    box.style.setProperty("width","400px","");			//定义盒子宽度为400像素
	    box.style.setProperty("height","200px","");			//定义盒子宽度为200像素
}
</script>
</head>
<body>
<div id="box" style="border:solid 1px red" >盒子</div>
</body>
</html> 
